class Subcategory {
  List<SubcategorySubjects>? subjects;

  Subcategory({
    this.subjects,
  });

  Subcategory.fromJson(Map<String, dynamic> json) {
    if (json['subjects'] != null) {
      subjects = (json['subjects'] as List)
          .map((e) => SubcategorySubjects.fromJson(e))
          .toList();
    }
  }

  Map<String, dynamic> toJson() {
    return {
      'subjects': subjects?.map((e) => e.toJson()).toList(),
    };
  }
}

class SubcategorySubjects {
  String? episodesInfo;
  String? rate;
  int? coverX;
  String? title;
  String? url;
  bool? playable;
  String? cover;
  String? id;
  int? coverY;
  bool? isNew;

  SubcategorySubjects({
    this.episodesInfo,
    this.rate,
    this.coverX,
    this.title,
    this.url,
    this.playable,
    this.cover,
    this.id,
    this.coverY,
    this.isNew,
  });

  SubcategorySubjects.fromJson(Map<String, dynamic> json) {
    episodesInfo = json['episodes_info']?.toString();
    rate = json['rate']?.toString();
    coverX = json['cover_x'];
    title = json['title']?.toString();
    url = json['url']?.toString();
    playable = json['playable'];
    cover = json['cover']?.toString();
    id = json['id']?.toString();
    coverY = json['cover_y'];
    isNew = json['is_new'];
  }

  Map<String, dynamic> toJson() {
    return {
      'episodes_info': episodesInfo,
      'rate': rate,
      'cover_x': coverX,
      'title': title,
      'url': url,
      'playable': playable,
      'cover': cover,
      'id': id,
      'cover_y': coverY,
      'is_new': isNew,
    };
  }
}

class SubategoryData {
  final List<SubcategorySubjects> data;
  final int page;
  final String selected = "";

  SubategoryData({required this.data, required this.page});
}
